﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.IO;

namespace SoftwareMonkeys.LogClimber.Business
{
    public class XmlLoader
    {
        public T Load<T>(string filePath)
        {
            T obj = default(T);
            using (StreamReader reader = new StreamReader(File.OpenRead(filePath)))
            {
                XmlSerializer serializer = new XmlSerializer(typeof(T));
                obj = (T)serializer.Deserialize(reader);
            }
            return obj;
        }
    }
}
